package xcron

import (
	"github.com/robfig/cron/v3"
	"time"
)

type Entry struct {
	entry cron.Entry
	ID    cron.EntryID
	// Next time the job will run, or the zero time if Cron has not been
	// started or this entry's schedule is unsatisfiable
	Next time.Time
	// Prev is the last time this job was run, or the zero time if never.
	Prev time.Time
	Name string
	Desc string
	Spec string
	Key  string
	cmd  Job
}

func (e Entry) Job() cron.Job {
	return e.cmd
}

func (e Entry) Run() {
	e.Job().Run()
}
